package com.xiaohongaiweno.configclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/config")
public class ConfigController {

    @Value("${xiaohongaiweno.hello}")
    String foo;

    @Resource
    private Environment env;

    @RequestMapping(value = "/foo")
    public String foo(){
        return foo + "——" + env.getProperty("xiaohongaiweno.hello");
    }
}
